home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / Formula1.swf / scripts / DefineButton2_88 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2004-07-27  |  1.7 KB  |  82 lines

  1. on(release){
  2.    loadVariablesNum("http://vodafone.panlogic.co.uk/enter_details_home.html",0);
  3.    count = 0;
  4.    Err = 0;
  5.    invChars = new Array(" ","#","$","%","!","^","~","\'","*","(",")",",","<",">","/","\\");
  6.    email = eval("/:email");
  7.    i = 0;
  8.    while(i < invChars.length)
  9.    {
  10.       if(email.indexOf(invChars[i]) >= 0)
  11.       {
  12.          Err = 1;
  13.       }
  14.       i++;
  15.    }
  16.    if(Err == 0)
  17.    {
  18.       i = 0;
  19.       while(i < email.length)
  20.       {
  21.          if(email.charAt(i) == "@")
  22.          {
  23.             count += 1;
  24.          }
  25.          i++;
  26.       }
  27.       if(count != 1)
  28.       {
  29.          Err = 2;
  30.       }
  31.    }
  32.    if(Err == 0)
  33.    {
  34.       splitEmail = email.split("@");
  35.       emailName = splitEmail[0];
  36.       emailDom = splitEmail[1];
  37.       if(emailName.length < 1)
  38.       {
  39.          Err = 3;
  40.       }
  41.       if(emailDom.indexOf(".") < 0)
  42.       {
  43.          Err = 4;
  44.       }
  45.       else
  46.       {
  47.          splitDom = emailDom.split(".");
  48.          if(splitDom[0].length < 2)
  49.          {
  50.             Err = 5;
  51.          }
  52.          if(splitDom[1].length < 2)
  53.          {
  54.             Err = 6;
  55.          }
  56.       }
  57.    }
  58.    if(0 < Err || eval("/:name") == null || eval("/:surname") == null || eval("/:tcs") == "no")
  59.    {
  60.       tellTarget("_root.win clip.alert_two")
  61.       {
  62.          play();
  63.       }
  64.    }
  65.    else if(eval("/:email") == eval("/:confemail"))
  66.    {
  67.       flag = 2;
  68.       fname = eval("/:name");
  69.       lname = eval("/:surname");
  70.       email = eval("/:email");
  71.       loadVariablesNum("http://vodafone.panlogic.co.uk/vodafone/servlet/vodafone",0,"POST");
  72.       play();
  73.    }
  74.    else
  75.    {
  76.       tellTarget("_root.win clip.alert_two")
  77.       {
  78.          play();
  79.       }
  80.    }
  81. }
  82.